# coding=utf-8
import requests

url = "https://www.baidu.com"

# 高匿
p = ["http://102.134.181.118:9999",
     "http://195.78.93.28:3128",
     "http://95.79.36.55:44861",
     "http://193.149.225.204:80",
     "http://213.6.199.94:49044",
     "http://113.120.34.69:9999",
     "http://202.7.53.128:49647",
     "http://117.141.155.244:53281",
     "http://119.2.54.204:44495",
     "http://176.12.125.241:8080",
     "http://14.207.68.2:8080",
     "http://103.28.37.131:3128",
     "http://103.86.106.17:999",
     "http://89.237.36.193:37647",
     "http://103.204.220.18:83",
     "http://113.121.241.131:8888",
     "http://120.83.110.18:9999",
     "http://190.89.40.5:999",
     "http://37.60.18.242:3128"]

# proxies = {"http": "http://189.11.248.162:8080"}
headers = {
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36"}
# for proxy in p:
#     proxies = {"http": proxy}
#     resp = requests.get(url, proxies=proxies, headers=headers)
#     print(resp.status_code)
# print(resp.cookies)
# c = requests.utils.dict_from_cookiejar(resp.cookies)
# print(c)
# urllib
# import socks
# import socket
# socks.set_default_proxy(socks.SOCKS5, "127.0.0.1", 9568)
# socket.socket = socks.socksocket

proxies = {"http": "http://114.55.95.112:8999"}
resp = requests.get(url, proxies=proxies, headers=headers)
print(resp.status_code)